-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more implications (including some implications of falsity) #494
Conversation
4a8d83d
to
edd9ebe
Compare
This is interesting @wilfwilson, I generally like the idea, and see this as a major improvement, but I'm vaguely worried that this feature relies on a (possibly) undocumented implementational detail of the type system in GAP (that if the default value of the bit corresponding to a |
Fair concern! I can't really imagine this is the sort of thing that would ever change about GAP. But even if it did, this trick is used in GAP itself, and now in at least one other package (polycyclic). So any change to GAP would have to be (and would be) either backwards compatible, or postponed until all packages using this trick were changed to use some other system. |
c2af90c
to
507c008
Compare
2f59a34
to
911ab89
Compare
911ab89
to
f399bc4
Compare
I've distilled this into its essence I think, maybe one day I'll make future improvements in a separate PR. As mentioned above, I do not think that this is the kind that of thing that will be changed in future versions of GAP. But I've added extensive tests for the implications of falsity, so we would immediately catch it if any of them ever stops working. There's no risks that this will give us wrong answers; I suppose the risk is just that the true methods won't do anything any more. If that ever becomes the case we can just remove them. |
I learned recently (see the discussion starting gap-system/gap#4546 (comment)) that you can use
to, in practice, automatically set
IsX(D) = false
whenIsY(D) = true
becomes known. The only pitfall is that ifIsX(D)
is already (i.e. wrongly) set totrue
, then this true method doesn't do anything; in particular it doesn't complain. So this doesn't help us to catch bugs (where properties get set incorrectly), but we weren't catching them anyway, and it does offer useful functionality for storing learned information.Therefore I have added some such '
InstallFalseMethod
's to Digraphs. This was made easier with the addition ofDigraphHasVertices
andDigraphHasEdges
, which allows me to easily exclude some trivial exceptions which would otherwise stop certain implications being added.I also added immediate methods for these things so that they are set to true or false once the attributes
DigraphNrVertices
andDigraphNrEdges
are known; similarly, I added immediate methods forDigraphNrVertices
andDigraphNrEdges
once the attributesDigraphVertices
andDigraphEdges
are known.I still need to add documentation and tests, and possibly I'll come up with some more
InstallTrueMethod
s to add.